#ifndef MYSQL_H
#define MYSQL_H

#include <QSqlDatabase>
#include <QFileInfo>
#include <Aliyun.h>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QThread>

class MySql :public QObject
{
    Q_OBJECT
public:
    MySql(QObject *parent = nullptr);
    ~MySql();
    void setfileInfo(QFileInfo const &fileinfo);
    void setseller_name(QString const &sellname);
    void setbuyer_name(QString const &buyname);
    QString getbuyer_name() const;
    void setinvoice_number(QString const &invoicenumber);
    void setinvoice_date(QString const &invoicedate);
    void settotal_amount(float const &totalamount);
    void settax_amount(float const &tax_amount);
    void setFileurl(QString const &url);
    void settittle(QString const &tt);
    void setvalue(QString const &v);
    QString getvalue() const;
    QString gettittle() const;
    QFileInfo getfileInfo()const;
    QSqlDatabase connectSql();
    //转换文件大小
    QString SizeChange(qint64 size);
    //执行sql语句
    void ExecSql(QString sqlcontent);

private:
    QFileInfo fileInfo;
    QString seller_name;
    QString buyer_name;
    QString invoice_number;
    QString invoice_date;
    float total_amount;
    float tax_amount;
    QString downurl;
    QString tittle;
    QString value;
};
#endif // MYSQL_H
